<template>
    <div class="demo1">
      你好啊 我是第一个demo
      <p>我叫{{name}},今年{{age}}岁了</p>
      <button @click="changeName">改名</button>
      <button @click="getAge">查看年龄</button>
    </div>
  </template>
  
  <script>
  export default {
      name:"Demo1",
      data() {
          return {
              name:"孙悟空",
              age: 10
          }
      },
      methods:{
          changeName() {
              this.name = '唐僧'
          },
          getAge() {
              alert(this.age)
          }
      }
  }
  </script>
  
  <style>
  
  </style>